;layui.define(function (e) {
    layui.use(['index', 'form', 'jquery', 'http', 'md5','common'], function () {

        var http = layui.http
            , form = layui.form
            , common = layui.common
            , $ = layui.jquery;

        var urls = {
            modifyData: "/core/user/modifyData"
        };

        form.on("submit(modifyData)", function (data) {
            //密码md5
            if (data.field['password']) {
                var pwd = $.md5(data.field['password']);
                data.field['password'] = pwd;
            }
            http.post({
                loading: true,
                loadingText: '数据提交中,请稍后...',
                url: urls.modifyData,
                data: data.field,
                success: function (res) {
                    parent.fn.refresh();
                    common.showSuccessTips('用户保存成功!');
                }
            });
            return false;
        });


    });

    e("core/user_modify", {});
});